package com.krisyu.strategyPattern.sp_practice1;

/**
 * @author KrisYu
 * @date 2022/5/23
 * @description
 */
public class StrategyContext {
    private IPushStrategy iPushStrategy = null;

    public StrategyContext(IPushStrategy iPushStrategy){
        this.iPushStrategy = iPushStrategy;
    }

    public void execute(){
        if(iPushStrategy != null){
            iPushStrategy.beforePush();
            iPushStrategy.doPush();
            iPushStrategy.afterPush();
        }
    }
}
